#!/sbin/openrc-run
supervisor=supervise-daemon

name="BuildKit Daemon"
description="Standalone buildkitd"

command="${buildkitd_command:-/usr/bin/buildkitd}"
command_args="${buildkitd_opts:---oci-worker=false --containerd-worker=true}"
rc_ulimit="${ulimit_opts:--c unlimited -n 1048576 -u unlimited}"
retry="${signal_retry:-TERM/60/KILL/10}"

log_file="${log_file:-/var/log/${RC_SVCNAME}.log}"
err_file="${err_file:-${log_file}}"
log_mode="${log_mode:-0644}"
log_owner="${log_owner:-root}"

supervise_daemon_args="${supervise_daemon_opts:---stderr \"${err_file}\" --stdout \"${log_file}\"}"

start_pre() {
	checkpath -f -m "$log_mode" -o "$log_owner" "$log_file" "$err_file"
}
